import java.rmi.*;
import java.rmi.server.*;
import java.net.*;
import java.io.*;
import java.util.*;

public class Clock
{
  public int zegar;
  public int iterator;
    
  public Clock(int time, int it)
  {
    this.zegar = time;
    this.iterator = it;
  }

  public void add_time(int time)
  {
    if(zegar < time)
    {
      zegar = time + iterator;
    }
    else
    {
      zegar += iterator;
    }
  }
}